/*
 * @Descripttion:
 * @Author: Wang Dejiang(aei)
 * @Date: 2022-04-12 19:02:47
 * @LastEditors: Wang Dejiang(aei)
 * @LastEditTime: 2022-05-04 22:08:43
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import prismjs from 'vite-plugin-prismjs'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
    vue(),
    prismjs({
      languages: ['json', 'javascript', 'bash', 'typescript'],
    }),
  ],
  build: {
    chunkSizeWarningLimit: 1000, //增大文件大小限制
    outDir: 'htmlDist',
    rollupOptions: {
      output: {
        manualChunks: {
          // element: ['element-plus'], //将element-plus的文件单独打包
        },
      },
    },
  },
})
